<html>
<body>
<canvas id="canvas" width="600" height="100" ></canvas>
<script>
var canvas = document.getElementById("canvas");
var context = canvas.getContext("2d");

var offscreenCanvas1 = new OffscreenCanvas(100, 100);
var ctx1 = offscreenCanvas1.getContext('2d');
ctx1.fillStyle = 'green';
ctx1.fillRect(0, 0, 100, 100);
var offscreenCanvas2 = new OffscreenCanvas(100, 100);
var ctx2 = offscreenCanvas2.getContext('2d');

ctx2.globalAlpha = 0.0;
ctx2.drawImage(offscreenCanvas1, 0, 0);
context.drawImage(offscreenCanvas2, 0, 0, 100, 100, 0, 0, 100, 100);

ctx2.globalAlpha = 0.2;
ctx2.drawImage(offscreenCanvas1, 0, 0);
context.drawImage(offscreenCanvas2, 0, 0, 100, 100, 100, 0, 100, 100);

ctx2.globalAlpha = 0.4;
ctx2.drawImage(offscreenCanvas1, 0, 0);
context.drawImage(offscreenCanvas2, 0, 0, 100, 100, 200, 0, 100, 100);

ctx2.globalAlpha = 0.6;
ctx2.drawImage(offscreenCanvas1, 0, 0);
context.drawImage(offscreenCanvas2, 0, 0, 100, 100, 300, 0, 100, 100);

ctx2.globalAlpha = 0.8;
ctx2.drawImage(offscreenCanvas1, 0, 0);
context.drawImage(offscreenCanvas2, 0, 0, 100, 100, 400, 0, 100, 100);

ctx2.globalAlpha = 1.0;
ctx2.drawImage(offscreenCanvas1, 0, 0);
context.drawImage(offscreenCanvas2, 0, 0, 100, 100, 500, 0, 100, 100);
</script>
</body>
</html>
